<template>
	<view class="index_container">


		<!-- 懒加载 -->
		<view class="main">

			<view class="main_list">
				<view class="main_list_li" v-for="(item,index) in list" :key="item.id">
					<image :src="item.imgs"></image>
					<text>{{item.name}}</text>
				</view>
			</view>
		</view>

		<!-- 到底显示 -->
		<view v-if="flag" class="baseline">
			已经到底了!不要再拉了哟~~~
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

				city: '点击中', //城市
				curpage: 1, //当前请求的页数
				curpagesize: 6, //当前请求的页数的条数
				list: [], //房源数据
				// houselist包含数据: {
				// 	area: "仁寿县"
				// 	id: 1
				// 	imgs: "http://129.211.169.131:6368/imgs/1.jpg"
				// 	name: "美的云溪郡"
				// 	point: 117
				// 	price: 9000
				// 	range: "仁寿大道"
				// 	type: "4室2厅"
				// }

			flag:false,

			};
		},
		onLoad() {

		},
	onReachBottom() {
	
		this.list.length>10?this.flag=true:this.flag=false
				 //防抖  到底了 跳出函数
				if(this.isend) return 
		},
		onShow() {
			this.list = uni.getStorageSync('hislist')
			//这里注意!!!!tabBar的页面如果想要每次点击都更新,只能使用onShow
			console.log(uni.getStorageSync('hislist'), 'show')
	
		},

		onPullDownRefresh() {

			console.log('我头被拉了!!!!')
		},
		methods: {
	
			

		}
	}
</script>

<style lang="scss">
	@import '../../themes/themes.scss';

	.index_container {
		background-color: #f4f3f9;
		// position: relative;



		.main {
			background-color: $ex-color;
			// padding-top: 10px;
			// margin-bottom: 20px;

			.main_list {
				padding: 15px 30rpx;

				.main_list_li {
					margin-bottom: 8px;

					image {
						width: 240rpx;
						height: 180rpx;
					}

					text {
						font-size: 30rpx;
					}
				}
			}

		}

		// 底线
		.baseline {
			height: 400rpx;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			background-color: $ex-color;
		}
	}
</style>
